/**
 * @file   Node.h
 * @author xingyifan
 * @date   2021/08/19 11:29:46
 * 
 * @brief  Node
 * 
 * 
 */

#ifndef __NODE__
#define __NODE__

#include <iostream>

#define NONE -1

using namespace std;

template <typename T>
class Binary_Node
{
public:
    T value;
    Binary_Node *lc;
    Binary_Node *rc;
    Binary_Node *parent;

    u_int size; //the size of the sub node

    Binary_Node()
    {
        size = 0;
        value = NONE;
        lc = rc = parent = NULL;
    }

    // ~Binary_Node() {
    //     cout << "Node Deleted" << endl;
    // }
};

typedef int Color;
#define Red 0
#define Black 1

template <typename T>
class RBT_Node
{
public:
    T value;
    Color color;
    RBT_Node *lc;
    RBT_Node *rc;
    RBT_Node *parent;

    u_int size; //the size of the sub node

    RBT_Node()
    {
        size = 0;
        color = Black;
        value = NONE;
        lc = rc = parent = NULL;
    }

    // ~RBT_Node() {
    //     cout << "Node Deleted" << endl;
    // }
};

template <typename T>
class B_Node
{
public:
    T *value;
    B_Node *child;

    u_int size; //the size of this node

    B_Node()
    {
        size = 0;
        value = NULL;
        child = NULL;
    }

    // ~B_Node() {
    //     cout << "Node Deleted" << endl;
    // }
};

#endif